include:
  - app.jobseekers.local-core

Checkout JobSearch Code:
  svn.latest:
    - name: svn://svn-pg.jobstreet.com/JobSeekers/trunk/job-search
    - target: /tmp/svn/JobSeekers/job-search
    - user: lighttpd
    - username: ciuser
    - password: automation
    - unless: test -d /var/www/seekasia.com/JobSeekers/job-search

Copy local dev JobSearch Code to destination:
  cmd.run:
    - name: cp -r /tmp/svn/JobSeekers/job-search /var/www/seekasia.com/JobSeekers/
    - unless: test -d /var/www/seekasia.com/JobSeekers/job-search

Setup local dev JobSearch Config:
  cmd.run:
    - name: ant -file build-localdev.xml -Dconfig.env=localdev setup_config replace_live_domains create_symlinks
    - cwd: /var/www/seekasia.com/JobSeekers/job-search

Setup local dev JobSearch Controller Symlink:
  file.symlink:
    - name: /var/www/html/job-search
    - target: /var/www/seekasia.com/JobSeekers/job-search/Controller

Setup local dev JobSearch Static Symlink:
  file.symlink:
    - name: /var/www/html/job-search-static
    - target: /var/www/seekasia.com/JobSeekers/job-search/Static

Custom Index page for Local Dev:
  file.managed:
    - name: /var/www/seekasia.com/JobSeekers/job-search/Controller/index.php
    - source: salt://app/job-search/local-index.php
